<template>
	
	<view class="row" @click="toClassList">
		<view class="row-left">
			<uni-icons :type="iconType" size="20"></uni-icons>
			<text class="text">{{text}}</text>
		</view>
		<view class="row-right">
			<text class="downloads">0</text>
			<uni-icons type="right" size="15" color="28b389"></uni-icons>
		</view>
	</view>
</template>

<script setup>
import { apiGetUserInfo } from '../../api/apis'
import {onLoad} from '@dcloudio/uni-app'
	defineProps({
		iconType: {
			type: String,
			default: 'spinner-cycle'
		},
		text: {
			type: String,
			defalut: '默认功能'
		}
	})
	
	onLoad(() => {
		getUserInfo()
	})
	
	const toClassList = () => {
		uni.navigateTo({
			url: '/pages/class-list/class-list'
		})
	}
	
	const getUserInfo = async () => {
		const data = await apiGetUserInfo()
		debugger
	}
</script>

<style lang="scss" scoped>
	.row {
		// border: 1rpx solid red;
	
		display: flex;
		justify-content: space-between;
		// align-items: center;
		border-bottom: 1rpx solid #eee;
		padding: 0 30rpx;
		height: 100rpx;

		&:last-child {
			border-bottom: 0;
		}

		.row-left {
			display: flex;
			justify-content: center;
			align-items: center;

			:deep(.my-icon-download-filled) {
			  color: $brand-theme-color !important;
			}

			.text {
				padding-left: 10rpx;
				color: #666;
			}
		}

		.row-right {
			display: flex;
			justify-content: center;
			align-items: center;

			.downloads {
				font-size: 28rpx;
				color: #aaa;
			}
		}
	}
</style>